﻿<%@ Control Language="c#" Inherits="TTQT.Administration.GroupCmd" CodeFile="GroupCmd.ascx.cs"
    CodeFileBaseClass="TTQT.MasterControl" %>
<table width="100%" cellpadding="0" cellspacing="0">
    <tr>
        <td align="center">
            <asp:Panel ID="pnGroupGrid" runat="server">
                <asp:DataGrid ID="dgGroup" runat="server" AutoGenerateColumns="False" PageSize="20"
                    Width="100%">
                    <PagerStyle Mode="NumericPages"></PagerStyle>
                    <AlternatingItemStyle CssClass="DarkRow"></AlternatingItemStyle>
                    <ItemStyle CssClass="LightRow"></ItemStyle>
                    <HeaderStyle Font-Bold="true" CssClass="HeaderRow"></HeaderStyle>
                    <Columns>
                        <asp:BoundColumn DataField="Group_Id" Visible="False" HeaderText="Group Id"></asp:BoundColumn>
                        <asp:BoundColumn DataField="Group_Name" HeaderText="Tên nhóm">
                            <HeaderStyle CssClass="HeaderRow"></HeaderStyle>
                        </asp:BoundColumn>
                        <asp:BoundColumn DataField="Group_Description" HeaderText="Mô tả">
                            <HeaderStyle></HeaderStyle>
                        </asp:BoundColumn>
                        <asp:BoundColumn DataField="CNDauMoi" HeaderText="Admin đầu mối được dùng">
                            <HeaderStyle></HeaderStyle>
                        </asp:BoundColumn>
                        <asp:BoundColumn DataField="CNKhongDauMoi" HeaderText="Admin CN được dùng">
                            <HeaderStyle></HeaderStyle>
                        </asp:BoundColumn>
                        <asp:TemplateColumn>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            <ItemTemplate>
                                <asp:Button CausesValidation="False" ID="cmdEdit" runat="server" Text="Sửa" Width="40"
                                    CommandName="cmdEdit"></asp:Button>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            <ItemTemplate>
                                <asp:Button CausesValidation="False" ID="cmdAssign" runat="server" Text="Phân quyền"
                                    Width="80" CommandName="cmdAssign"></asp:Button>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            <ItemTemplate>
                                <asp:Button CausesValidation="False" ID="cmdDelete" runat="server" Text="Xóa" Width="40"
                                    CommandName="cmdDelete"></asp:Button>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                    </Columns>
                </asp:DataGrid>
                <asp:Button ID="cmdAddGroup" runat="server" Text="Thêm mới" OnClick="cmdAddGroup_Click">
                </asp:Button>
            </asp:Panel>
            <asp:Panel ID="pnEdit" runat="server">
                <table class="Area" style="border-right: gray 1px solid; border-top: gray 1px solid;
                    border-left: gray 1px solid; border-bottom: gray 1px solid" cellspacing="5" cellpadding="0"
                    width="500" border="0">
                    <tr>
                        <td style="color: blue" align="center" colspan="3">
                            <asp:Label ID="Label1" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td width="10">
                        </td>
                        <td width="30%">
                        </td>
                        <td width="70%">
                            <asp:TextBox ID="txtGroupID" Width="200px" runat="server" Visible="False" Enabled="False"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td width="10">
                        </td>
                        <td class="label">
                            Tên nhóm</td>
                        <td>
                            <asp:TextBox ID="txtGroupName" Width="200px" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="GroupNameRequired" runat="server" Display="Dynamic"
                                ControlToValidate="txtGroupName" ErrorMessage="(*)"></asp:RequiredFieldValidator></td>
                    </tr>
                    <tr>
                        <td width="10">
                        </td>
                        <td class="label">
                            Mô tả</td>
                        <td>
                            <asp:TextBox ID="txtGroupDescription" Width="200px" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="txtGroupDescriptionRequired" runat="server" Display="Dynamic"
                                ControlToValidate="txtGroupDescription" ErrorMessage="(*)"></asp:RequiredFieldValidator></td>
                    </tr>
                    <tr runat="server" id="trCN" visible="false">
                        <td width="10">
                        </td>
                        <td class="label">
                            CN được dùng</td>
                        <td>
                            <asp:checkbox ID="chkCNDuocPhan" Text=" Cho phép QLCN được phân quyền" Width="200px" runat="server" Visible="False"></asp:checkbox>
                            </td>
                    </tr>
                    <tr>
                        <td width="10">
                        </td>
                        <td class="label">
                            CN đầu mối</td>
                        <td>
                            <asp:CheckBox runat="server" ID="chkCNDauMoi" Text="Cho phép admin chi nhánh đầu mối sử dụng" />
                        </td>
                    </tr>
                    <tr>
                        <td width="10">
                        </td>
                        <td class="label">
                            CN khác</td>
                        <td>
                            <asp:CheckBox runat="server" ID="chkCNKhongDauMoi" Text="Cho phép admin chi nhánh không phải đầu mối sử dụng" />
                        </td>
                    </tr>
                    <tr>
                        <td style="color: red; font-family: arial" align="center" colspan="3" height="10">
                            <asp:Label ID="lblError" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td align="center" colspan="3">
                            <asp:Button ID="cmdUpdate" Width="72px" Text="Cập nhật" runat="server" CausesValidation="true"
                                OnClick="cmdUpdate_Click"></asp:Button>
                            <asp:Button ID="cmdCancel" Width="72" Text="Quay lại" runat="server" CausesValidation="False"
                                OnClick="cmdCancel_Click"></asp:Button></td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="pnAssignPermission" runat="server">
                <table class="SidePanel" id="table1" cellspacing="0" cellpadding="5" width="600"
                    align="center" border="0">
                    <tr>
                        <td align="center" colspan="3">
                            Tên nhóm:
                            <asp:Label ID="lblGroupName" runat="server" ForeColor="Red"></asp:Label></td>
                    </tr>
                    <tr align="center">
                        <td width="50%">
                            Danh sách các chức năng</td>
                        <td width="50">
                        </td>
                        <td width="50%">
                            Các chức năng được truy cập</td>
                    </tr>
                    <tr align="center">
                        <td>
                            <asp:ListBox ID="lstRoles" Width="100%" runat="server" SelectionMode="Multiple" Rows="15">
                            </asp:ListBox></td>
                        <td valign="middle">
                            <asp:Button ID="cmdAdd" Width="45px" Text=">>" runat="server" OnClick="cmdAdd_Click">
                            </asp:Button><br>
                            <asp:Button ID="cmdRemover" Width="45px" Text="<<" runat="server" OnClick="cmdRemover_Click">
                            </asp:Button></td>
                        <td>
                            <asp:ListBox ID="lstGroupRoles" Width="100%" runat="server" SelectionMode="Multiple"
                                Rows="15"></asp:ListBox></td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <asp:Label ID="lblUpdateStatus" runat="server"></asp:Label></td>
                    </tr>
                </table>
                <br />
                <div style="text-align: center;">
                    <asp:Button runat="server" ID="cmdQuayLai" Text="Quay lại" OnClick="cmdQuayLai_Click" />
                </div>
            </asp:Panel>
        </td>
    </tr>
</table>
